﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BonsaiScrum.Core.Domain
{
    public class AuthorizationException : Exception
    {
        public AuthorizationException(string userName, Type roleType)
        {
            UserName = userName;
            RoleType = roleType;
        }

        public string UserName { get; private set; }
        public Type RoleType { get; private set; }

        public override string Message
        {
            get
            {
                return string.Format("{0} is not authorized for the {1} role.", UserName, RoleType.FullName);
            }
        }
    }
}
